/* 
 *  Copyright (C) 2006 James Young
 * `gurumind(a)gmail.com
 * 
 */

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace IPDEditor
{
    public partial class HRTEditor : IPDEditor.IPDEditorBase
    {
        public IPDUIField ipdUIHRT;

        public HRTEditor()
        {
            InitializeComponent();
        }

        private void HRTEditor_Load(object sender, EventArgs e)
        { 
            //tbeLabel.Text = "Host Routing Table Visual Editor";
        }

        protected override string EditorName
        {
            get
            {
                return "Host Routing Table";
            }
        }

        public override void FillData(IPDField field)
        {
            IPDFieldHRT hrt = (IPDFieldHRT)field;
            tbNetworkProviderCode.Text = hrt.NetworkProviderCode.ToString();
            tbNetworkId.Text = hrt.NetworkID.ToString();
            tbNetworkName.Text = hrt.NetworkName;
            tbGprsAPN.Text = hrt.GPRSAPN;
            tbGprsQos.Text = hrt.GPRSQOS;
            tbGprsIpAddressList.Text = hrt.GPRSIPAddressList;
            tbGprsUdpPortList.Text = hrt.GPRSUDPPortList;
        }

        protected override void Save()
        {
            IPDFieldHRT hrt = (IPDFieldHRT)ipdUIHRT.field;

            hrt.NetworkProviderCode = int.Parse(tbNetworkProviderCode.Text);
            hrt.NetworkID = byte.Parse(tbNetworkId.Text);
            hrt.NetworkName = tbNetworkName.Text;
            hrt.GPRSAPN = tbGprsAPN.Text;
            hrt.GPRSQOS = tbGprsQos.Text;
            hrt.GPRSIPAddressList = tbGprsIpAddressList.Text;
            hrt.GPRSUDPPortList = tbGprsUdpPortList.Text;
        }

        private void tbUdpPortList_TextChanged(object sender, EventArgs e)
        {

        }

        private void label4_Click(object sender, EventArgs e)
        {

        }

        private void label6_Click(object sender, EventArgs e)
        {

        }

        private void tbGprsIpAddressList_TextChanged(object sender, EventArgs e)
        {

        }

        private void label5_Click(object sender, EventArgs e)
        {

        }

        private void tbGprsQos_TextChanged(object sender, EventArgs e)
        {

        }

        private void tbGprsAPN_TextChanged(object sender, EventArgs e)
        {

        }

        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void tbNetworkName_TextChanged(object sender, EventArgs e)
        {

        }

        private void label2_Click(object sender, EventArgs e)
        {

        }
        
    }
}

